package com.nian.text;

import com.nian.dao.UserDao;
import com.nian.dao.impl.UserDaoImpl;
import com.nian.pojo.Product;
import com.nian.pojo.User;
import org.junit.Assert;
import org.junit.Test;

import java.util.Date;
import java.util.List;

public class UserDaoImplText {
    @Test
    public void addUserText(){
        UserDaoImpl userDao = new UserDaoImpl();
        User user = new User();
        user.setUsername("大司马1");
        user.setPassword("123456");
        user.setEmail("278736146@qq.com");
        boolean result = userDao.addUser(user);
        Assert.assertEquals(true,result);
    }
    @Test
    public void deleteUserText(){
        UserDaoImpl userDao = new UserDaoImpl();
        User user = new User();
        user.setId(3);
        boolean result = userDao.dlUser(user);
        Assert.assertEquals(true,result);
    }
    @Test
    public void reUserText(){
        UserDaoImpl userDao = new UserDaoImpl();
        User user = new User();
        user.setId(1);
        user.setUsername("dasima");
        user.setPassword("123456");
        user.setGender("男");
        user.setEmail("278736146@qq.com");
        user.setTelephone("18065782102");
        user.setIntroduce("不可以涩涩");
        user.setActiveCode(null);
        user.setState(null);
        user.setRole(null);
        user.setregisTime(new Date());
        boolean result = userDao.reUser(user);
        Assert.assertEquals(true,result);
    }

}
